package com.mengyan.manage.cms.controller;

import com.mengyan.api.cms.CmsConfigControllerApi;
import com.mengyan.framework.domain.cms.CmsConfig;
import com.mengyan.manage.cms.service.PageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by mengyan on 2019/2/10.
 */
@RestController
@RequestMapping("/cms/config")
public class CmsConfigController implements CmsConfigControllerApi {

    private final PageService pageService;

    @Autowired
    public CmsConfigController(PageService pageService) {
        this.pageService = pageService;
    }

    @Override
    @GetMapping("/getModel/{id}")
    public CmsConfig getModel(@PathVariable("id") String id) {
        return pageService.getConfigById(id);
    }
}
